package view.CommonView;


import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;

import javax.swing.JLabel;

import view.MainView;

/**
 * @Author: Lin Hongwei
 * @LastEditors: Lin Hongwei
 * @email: 1365755396@qq.com
 * @CSDN: https://blog.csdn.net/weixin_45429409
 * @Description: 封装用户信息显示公用组件
 *
 */
public class CommonUserInfoView extends CommonJPanel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public static final int MAX_DAY= 90; 

	public static JLabel userNameTxt, userTypeTxt, numTxt, bookPressTimeTxt;

	public CommonUserInfoView() {
		super(TYPE_TRANSPARENT);

		setLayout(new FlowLayout(FlowLayout.CENTER, 30, 20));
		setPreferredSize(new Dimension(MainView.instance.getWidth(), 100));

		int width = MainView.instance.getWidth() / 2 - 180;

		// 
		JLabel labelName = new JLabel("读者姓名：");
		labelName.setPreferredSize(new Dimension(80, 20));
		add(labelName);
		userNameTxt = new JLabel("谢谢谢谢");
		userNameTxt.setPreferredSize(new Dimension(width, 20));
		userNameTxt.setForeground(Color.RED);
		add(userNameTxt);
		// 
		JLabel labelUserType = new JLabel("读者类型：");
		labelUserType.setPreferredSize(new Dimension(80, 20));
		add(labelUserType);
		userTypeTxt = new JLabel("哈哈哈");
		userTypeTxt.setPreferredSize(new Dimension(width, 20));
		userTypeTxt.setForeground(Color.RED);
		add(userTypeTxt);
		// 
		JLabel labelNum = new JLabel("最大可借数：");
		labelNum.setPreferredSize(new Dimension(80, 20));
		add(labelNum);
		numTxt = new JLabel("18");
		numTxt.setPreferredSize(new Dimension(width, 20));
		numTxt.setForeground(Color.RED);
		add(numTxt);
		// 
		JLabel labelBookPressTime = new JLabel("最大可借天数：");
		labelBookPressTime.setPreferredSize(new Dimension(100, 20));
		add(labelBookPressTime);
		bookPressTimeTxt = new JLabel(String.valueOf(MAX_DAY) );
		bookPressTimeTxt.setPreferredSize(new Dimension(width - 20, 20));
		bookPressTimeTxt.setForeground(Color.RED);
		add(bookPressTimeTxt);
		
	}

}
